// my_main.h

#ifndef MY_MAIN_H
#define MY_MAIN_H

// if using a real in-circuit debugger then comment the section 
// below else if using a bootloader then this section of code will
// remind you to compile in Release mode since the Debug version
// will not work with the bootloader.
#ifdef __DEBUG
  #error You are in Debug mode. Switch to Release mode.
#endif

// clock speed defines

#define SYSCLK 48000000				// system clock
#define PBCLK  48000000				// peripheral bus clock

// display LEDs

#define LED_INIT TRISB
#define LED_OUT LATB

// USB settings (comment or uncomment as desired)

#define USE_USB 				// enable USB
#define USE_USB_PRINTF			// use USB fort printf output

// UART (comment or uncomment as desired)

#define USE_UART

// Vex Ultrasonic (comment or uncomment as desired)
//  All these require timer T2: must also enable delayT2_init() below

//#define USE_VEX_ULTRASONIC1	// #1 uses pins RC0, RC1
//#define USE_VEX_ULTRASONIC2	// #2 uses pins RD0, RD1
//#define USE_VEX_ULTRASONIC3	// #3 uses pins RD2, RD3

// I2C (comment or uncomment as desired)

//#define USE_I2C

// Free-running clock for elapsed time (uses timer T0 and frreclk interrupt)
  
#define USE_FREECLK  

// delay-timers; must not conflict with other time usage

//#define USE_DELAY_TIMER0		// cannot use with free-running clock
#define USE_DELAY_TIMER1
//#define USE_DELAY_TIMER2		// cannot use with Vex ultrasonic
//#define USE_DELAY_TIMER3



// DO NOT EDIT BELOW 

// define PRINTF to output to usb or uart
#ifdef USE_USB_PRINTF
	#define PRINTF		lib_usb_cdc_printf_blocked	// output to usb
#else
	#define PRINTF		printf						// output to uart (default)
#endif

void my_main(void);

#endif
